package indi.flynn.zhouyi.url;

import com.google.common.base.Splitter;
import org.springframework.web.util.UriComponentsBuilder;

import java.util.Map;

/**
 * @author fenglin
 * @since 2025/5/27
 */
public class Url {
    public static void main(String[] args) {
        Map<String, String> addParamMap = Splitter.on("&").withKeyValueSeparator("=").split("k=v&k1=v1");
        UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("https://www.baidu.com?a=b&");
        for (Map.Entry<String, String> entry : addParamMap.entrySet()) {
            builder.queryParam(entry.getKey(), entry.getValue());
        }
        System.out.println(builder.toUriString());
    }
}
